#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
int head[N];
int ver[N << 1], Next[N << 1], tot;
void add(int u, int v) {
  ++tot;
  ver[tot] = v;
  Next[tot] = head[u];
  head[u] = tot;
}
int dep[N], sz[N], fa[N], son[N], top[N];
int pos[N], b[N], num;
void dfs(int u, int fu) {
  dep[u] = dep[fu] + 1;
  sz[u] = 1;
  fa[u] = fu;
  for (int i = head[u]; i; i = Next[i]) {
    int v = ver[i];
    if (v == fu) continue;
    dfs(v, u);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
}
void dfs2(int u, int fu, int t) {
  top[u] = t;
  pos[u] = ++num;
  b[num] = a[u];
  if (!son[u]) return;
  dfs2(son[u], u, t);
  for (int i = head[u]; i; i = Next[i]) {
    int v = ver[i];
    if (v == fu || v == son[u]) continue;
    dfs2(v, u, v);
  }
}
ll sum[N << 2], tag[N << 2];
void pushup(int p) { sum[p] = sum[p << 1] + sum[p << 1 | 1]; }
void addtag(ll d, int p, int l, int r) {
  sum[p] += 1ll * d * (r + 1 - l);
  tag[p] += d;
}
void pushdown(int p, int l, int r) {
  if (tag[p]) {
    int mid = (l + r) >> 1;
    addtag(tag[p], p << 1, l, mid);
    addtag(tag[p], p << 1 | 1, mid + 1, r);
    tag[p] = 0;
  }
}
void build(int p, int l, int r) {
  tag[p] = 0;
  if (l == r) {
    sum[p] = b[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
void update(int x, ll d, int p, int l, int r) {
  if (l == r) {
    sum[p] += d;
    return;
  }
  pushdown(p, l, r);
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(x, d, p << 1, l, mid);
  else
    update(x, d, p << 1 | 1, mid + 1, r);
  pushup(p);
}
void update(int L, int R, ll d, int p, int l, int r) {
  if (L <= l && R >= r) {
    addtag(d, p, l, r);
    return;
  }
  pushdown(p, l, r);
  int mid = (l + r) >> 1;
  if (L <= mid) update(L, R, d, p << 1, l, mid);
  if (R > mid) update(L, R, d, p << 1 | 1, mid + 1, r);
  pushup(p);
}
ll query(int L, int R, int p, int l, int r) {
  if (L <= l && R >= r) return sum[p];
  pushdown(p, l, r);
  int mid = (l + r) >> 1;
  ll res = 0;
  if (L <= mid) res += query(L, R, p << 1, l, mid);
  if (R > mid) res += query(L, R, p << 1 | 1, mid + 1, r);
  return res;
}
ll query(int u) {
  ll res = 0;
  while (top[u] != 1) {
    res += query(pos[top[u]], pos[u], 1, 1, n);
    u = fa[top[u]];
  }
  res += query(pos[1], pos[u], 1, 1, n);
  return res;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) cin >> a[i];
  rep(i, 2, n) {
    int u, v;
    cin >> u >> v;
    add(u, v), add(v, u);
  }
  dfs(1, 0);
  dfs2(1, 0, 1);
  build(1, 1, n);
  while (m--) {
    int op, x, y;
    cin >> op;
    if (op == 1) {
      cin >> x >> y;
      update(pos[x], y, 1, 1, n);
    } else if (op == 2) {
      cin >> x >> y;
      update(pos[x], pos[x] + sz[x] - 1, y, 1, 1, n);
    } else {
      cin >> x;
      cout << query(x) << endl;
    }
  }
  return 0;
}